package com.niiwoo.civet.trade.dto.newRefund;

import com.niiwoo.tripod.lanmao.enums.BusinessTypeEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 本利罚待收
 */
@Data
public class ReceiveFeeDTO implements Comparable<ReceiveFeeDTO>{
    private Long planId;// 回款计划id
    private Integer period;
    private Long accountId;// 收款方账户id
    private String userId;// 收款方用户id
    private String platformUserNo;// 收款方存管用户编号
    private BigDecimal capital;
    private BigDecimal interest;
    private BigDecimal expectInterest;
    private BigDecimal penaltyFee;// 待收罚息
    private BigDecimal receivedPenaltyFee;// 已收罚息
    private BusinessTypeEnum businessTypeEnum;// 还款，还代偿款区分
    private Date investTime;// 投资时间
    private Long investOrderId;// 投资订单号
    private Date receiveDate;// 应回款时间


    @Override
    public int compareTo(ReceiveFeeDTO o) {
        if(this.getPeriod() > o.getPeriod()){
            return 1;
        }else if(this.getPeriod().equals(o.getPeriod())){
            if(this.getInvestTime().after(o.getInvestTime())){
                return 1;
            } else if(this.getInvestTime().equals(o.getInvestTime())){
                if(this.getInvestOrderId() > o.getInvestOrderId()){
                    return 1;
                } else if(this.getInvestOrderId().equals(o.getInvestOrderId())){
                    return 0;
                } else{
                    return -1;
                }
            } else{
                return -1;
            }
        }else{
            return -1;
        }
    }
}
